
#pragma once

#include <math.h>
#include <float.h>
#include <limits.h>
#include <assert.h>

template <typename T>
void Var_ExChange(T& a,T& b){T t = a;a=b;b=t;}

#define M_EPSILON 1e-6
#define ON_EPSILON 1e-5

#ifndef M_PI
#define M_PI (3.1415926536)
#endif

#ifndef M_E
#define M_E (2.7182818284590452354)
#endif
#define DEG2RAD (M_PI/180.0)

#define FIS_EQ(a,b) ((fabs((float)(a)-(b)) >= (float) FTOLER) ? 0 : 1)

#define FIS_EQ1(a,b) ((fabs((float)(a)-(b)) >= (float) 1e-1) ? 0 : 1)
#define FIS_EQ2(a,b) ((fabs((float)(a)-(b)) >= (float) 1e-2) ? 0 : 1)
#define FIS_EQ3(a,b) ((fabs((float)(a)-(b)) >= (float) 1e-3) ? 0 : 1)
#define FIS_EQ4(a,b) ((fabs((float)(a)-(b)) >= (float) 1e-4) ? 0 : 1)

